package Java攻略._3_流式操作._2_装箱流;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class _11_使用mapToObj方法 {

    public static void main(String[] args) {
        List<Integer> collect = IntStream.of(1, 2, 3, 4, 5)
                .mapToObj(n -> Integer.valueOf(n))
                .collect(Collectors.toList());

        System.out.println(collect);

        List<Integer> collect1 = IntStream.of(1, 2, 3, 4, 5)
                .mapToObj(Integer::valueOf)
                .collect(Collectors.toList());

        System.out.println(collect1);
    }
}
